package com.example.weatherpromax

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView

class Mainface : AppCompatActivity() {
    val todayList = ArrayList<weather_today>()
    val futureList = ArrayList<weather_future>()
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.weather)

        init_today()
        val weatherToday:RecyclerView = findViewById(R.id.hourly_weather)
        val weatherTodayManager = LinearLayoutManager(this)
        weatherTodayManager.orientation = LinearLayoutManager.HORIZONTAL
        weatherToday.layoutManager = weatherTodayManager
        val hourAdapter = hourAdapter(todayList)
        weatherToday.adapter = hourAdapter

        init_future()
        val weatherFuture:RecyclerView = findViewById(R.id.dayly_weather)
        val weatherFutureManager = LinearLayoutManager(this)
        weatherFutureManager.orientation = LinearLayoutManager.VERTICAL
        weatherFuture.layoutManager = weatherFutureManager
        val dayAdapter = dayAdapter(futureList)
        weatherFuture.adapter = dayAdapter
   }
    private fun init_today(){
        repeat(5){
            todayList.add(weather_today("EOS 1DX markII ",R.drawable.selected_map))
            todayList.add(weather_today("X℃EOS 1DX markII ",R.drawable.selected_map))
            todayList.add(weather_today("X℃EOS 1DX markII EOS 1DX markII ",R.drawable.selected_map))
            todayList.add(weather_today("X℃",R.drawable.selected_map))
            todayList.add(weather_today("X℃",R.drawable.selected_map))
            todayList.add(weather_today("X℃",R.drawable.selected_map))
            todayList.add(weather_today("X℃",R.drawable.selected_map))
        }
    }
    private fun init_future(){
    repeat(5){
        futureList.add(weather_future("X℃","X℃",R.drawable.selected_map))
        futureList.add(weather_future("X℃","X℃",R.drawable.selected_map))
        futureList.add(weather_future("X℃","X℃",R.drawable.selected_map))
        futureList.add(weather_future("X℃","X℃",R.drawable.selected_map))
        futureList.add(weather_future("X℃","X℃",R.drawable.selected_map))
        futureList.add(weather_future("X℃","X℃",R.drawable.selected_map))
        futureList.add(weather_future("X℃","X℃",R.drawable.selected_map))
        futureList.add(weather_future("X℃","X℃",R.drawable.selected_map))
        futureList.add(weather_future("X℃","X℃",R.drawable.selected_map))

















    }
}
}